package vcexam;

import java.io.File;
import java.io.IOException;
import java.text.NumberFormat;
import java.util.Locale;

class Super {
	private int a;

	protected Super(int a) {
		this.a = a;
	}
}

class Sub extends Super {
	public Sub(int a) {
		super(a);
	}

	// public Sub() { this.a = 5; }
	public Sub() {
		this(5);
	}
	// public Sub() { super(5); }
}

abstract class Vehicle {
	public int speed() {
		return 0;
	}
}

class Car extends Vehicle {
	public int speed() {
		return 60;
	}
}

class RaceCar extends Car {
	public int speed() {
		return 150;
	}
}

public class Subclase {

	public static void main(String[] args) {
		RaceCar racer = new RaceCar();
//		RaceCar racer2 = (RaceCar) new Car();
		Car car =  new RaceCar();
		Vehicle vehicle = new RaceCar();
		System.out.println(racer.speed() + ", " + car.speed() + ", "
				+ vehicle.speed());
		
		double input = 314159.26;
		NumberFormat nf = NumberFormat.getInstance(Locale.ITALIAN);
		String b;
//		b = nf.parse( input ); //The method parse(String) in the type NumberFormat is not applicable for the arguments (double)
		b = nf.format( input );
//		b = nf.equals( input ); //Type mismatch: cannot convert from boolean to String
//		b = nf.parseObject( input ); //The method parseObject(String) in the type Format is not applicable for the arguments (double)
		System.out.println(b);
		
		/*
		 * 
		 */
		
		 File dir = new File("dir");
	        dir.mkdir();
	        File f1 = new File(dir, "f1.txt");
	        try {
	            f1.createNewFile();
	        } catch (IOException e) { ; }
	        File newDir = new File("newDir");
	        dir.renameTo(newDir);
		
	}

}
